package com.tongji.housediy.view
{
	import com.tongji.housediy.model.BrandModel;
	import com.tongji.housediy.model.GoodsModel;
	import com.tongji.housediy.vo.Brand;
	
	import flash.events.MouseEvent;
	
	import mx.binding.utils.BindingUtils;
	import mx.controls.Alert;
	
	import org.robotlegs.mvcs.Mediator;
	
	/**
	 * 
	 * @author yanghanbing
	 * 2011/5/06
	 */ 
	public class SecondLayerShowMediator extends Mediator
	{
		[Inject]
		public var view:SecondLayorShowComp;
		
		[Inject]
		public var brandModel:BrandModel;
		
		[Inject]
		public var goodsModel:GoodsModel;
		
		override public function onRegister():void
		{			
			switch(view.currentState)
			{
				case"State1":
					BindingUtils.bindProperty(view.goodsCount, "text", goodsModel, "goodsCount");
					BindingUtils.bindProperty(view.collectionList.dataGroup, "dataProvider", goodsModel, "collectionArray");
					break;
				case "State2":
					BindingUtils.bindProperty(view.brandsViewStack.allBrandList.dataGroup, "dataProvider", brandModel, "brandList");
                    break;
			}
		}

	}
}